The timing of endoscopic intervention for necrotizing pancreatitis is determined based on the degree of encapsulation